package com.qms.app.service.impl;

import com.qms.app.bean.Logs;
import com.qms.app.dao.LogsDao;
import com.qms.app.service.LogsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class LogsServiceImpl implements LogsService {
    @Autowired
    private LogsDao logsDao;

    @Override
    public boolean saveLogs(Logs logs) {
        return logsDao.save(logs)>0;
    }

    @Override
    public List<Logs> listLogs(Integer page, Integer rows, String opername) {
        return logsDao.list((page-1)*rows,rows,opername);
    }

    @Override
    public int countLogs(String opername) {
        return logsDao.count(opername);
    }

    @Override
    public List<Logs> countLogsTimes() {
        return logsDao.countLogsTimes();
    }
}
